<?php
namespace Home\Controller;
use Think\Controller;
use Think\Verify;

class OrderLoginController extends Controller {
    public function index(){
        if(IS_POST){
            $Verify = new Verify();
            if( $Verify->check(I('post.check_code')) ){
                session('mobile',I('post.mobile'));
                redirect(U('Home/OrderLogin/address'));
            }else{
                $this->error('验证码错误！',U('Home/OrderLogin/index'));
            }
        }
        session(null);
        $this->display();
    }


    public function chkcode(){
        $config =    array(
            'fontSize'    =>    30,    // 验证码字体大小
            'length'      =>    4,     // 验证码位数
            'useNoise'    =>    false, // 关闭验证码杂点
        );
        ob_clean();
        $Verify = new \Think\Verify($config);
        $Verify->entry();
    }

    public function address(){
        if(IS_POST){
            session('address',I('post.address'));
            redirect(U('Home/index/index'));
        }
        $this->display();
    }
}